package com.gaofeng.day21;

import java.util.ArrayList;
import java.util.Collections;
import java.util.function.Function;

public class demo05 {
    public static void main(String[] args) {
//        ArrayList<String> list = new ArrayList<>();
//        Collections.addAll(list,"1","2","3","4","5","6","7");
//
//        list.stream().map(new Function<String, Integer>() {
//            @Override
//            public Integer apply(String s) {
//                int num = Integer.parseInt(s);
//                return num;
//            }
//        }).forEach(s -> System.out.println(s));

        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"1","2","3","4","5","6","7");

        list.stream().map(Integer::parseInt).forEach(s -> System.out.println(s));



    }
}
